import { ref } from "vue";
import getURL from "@/utils/http/address";
//图片验证码相关
const RequestUrl = ref(getURL);
const RequestJson = ref("/json");

const guid = () => {
  return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
};

const oriValidImages = ref(
  RequestUrl.value + "/api/User/GetValidateCodeImages?t="
);
const FormatToken = (res: string) => {
  return decodeURIComponent(
    escape(window.atob(res.replace("-", "+").replace("_", "/").split(".")[1]))
  );
};
export { RequestUrl, RequestJson, oriValidImages, guid, FormatToken };
